using System;
using System.Configuration;

using SBPweb.Common.Configuration;

namespace SBPweb.PROvibe.Business.Logic
{
	public class ConfigurationManager
	{

		#region Constructor logic

		private ConfigurationManager()
		{
		}

		#endregion

		public class ConnectionStrings
		{

			private static ConnectionStringsSection mConns;

			public static string Warehouse
			{
				get
				{
					if (mConns == null)
					{
						mConns = ConfigurationHandler.GetSection<ConnectionStringsSection>("connectionStrings");
					}
					return mConns.ConnectionStrings["Warehouse"].ConnectionString;
				}
			}

		}

		public class CacheExpirations
		{

			private static bool mUseCaching = true;

			public static bool IsCachingUsed
			{
				get
				{
					return mUseCaching;
				}
				set
				{
					mUseCaching = value;
				}
			}

			public class Warehouse
			{

				public static TimeSpan Actors
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

				public static TimeSpan Roles
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

				public static TimeSpan Sites
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

				public static TimeSpan ActorSiteRoles
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

                public static TimeSpan Modules
                {
                    get
                    {
                        return TimeSpan.FromMinutes(20.0f);
                    }
                }
                
                public static TimeSpan Streams
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

				public static TimeSpan Templates
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

				public static TimeSpan Themes
				{
					get
					{
						return TimeSpan.FromMinutes(20.0f);
					}
				}

			}

		}

	}
}
